package com.ffox.mapper;

import com.ffox.entity.HomeworkProblem;
import com.ffox.entity.HomeworkProblemFile;
import com.ffox.entity.HomeworkResult;
import com.ffox.entity.HomeworkResultFile;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface HomeworkMapper {
//    添加作业
    Integer insertHomeworkProblem(HomeworkProblem problem);
    Integer insertHomeworkProblemFile(HomeworkProblemFile files);

//     添加作业结果
    Integer insertHomeworkResult(HomeworkResult result);
    Integer insertHomeworkResultFile(HomeworkResultFile files);

//     老师获取作业
    List<HomeworkProblem> getHomeworkProblemByUserNum(String userNum);
//    学生获取作业
    List<HomeworkProblem> getHomeworkProblemByClassId(Long classId);
//    根据作业ID获取作业附件
    List<HomeworkProblemFile> getHomeworkProblemFileByProblemId(Integer problemId);
//     根据作业ID获取作业结果
    List<HomeworkResult> getHomeworkResultByProblemId(String problemId);
//     根据作业结果ID获取作业结果附件
    List<HomeworkResultFile> getHomeworkResultFileByResultId(Long resultId);


    Integer updateHomeworkScoreAndTCommentAndCorrectTime(Long score, String tComment, LocalDateTime correctTime, Integer resultId);

    HomeworkResult getHomeworkResult(Integer problemId,String studentNum);

    Integer getHomeworkProblemLastID();

    Integer getHomeworkResultLastID();




}
